// 封装消息提示
import { Message as ElMessage, Loading as ElLoading } from '../../index'

export const message = ({ type, message, duration, showClose = false }) => {
    ElMessage({
        type,
        message: message,
        duration: duration || 2000,
        center: true,
        showClose
    })
}

export const loading = ({ text, textColor, background,fullscreen=false }) => {
    let result = undefined;
    result = ElLoading.service({
        fullscreen,
        lock: true,
        text: text || '加载中',
        textColor:textColor || '',
        background: background || 'rgba(0, 0, 0, 0.7)'
    })
    return result
}
